package com.peak.code;

import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;
import reactor.test.StepVerifierOptions;
import reactor.util.context.Context;

/**
 * @author likai
 * @date 2021/11/2 3:42 PM
 * @email likai9376@163.com
 * @desc 测试类
 */
public class Demo03 {

    public static void main(String[] args) {
        StepVerifier.create(Mono.just(1).map(i -> i + 10),
                StepVerifierOptions.create().withInitialContext(Context.of("thing1", "thing2")))
                .expectAccessibleContext()
                .contains("thing1", "thing2")
                .then()
                .expectNext(11)
                .verifyComplete();
    }
}
